package myky.com.doctorapp.contract;

import io.reactivex.Observable;
import myky.com.doctorapp.entity.LoginEntity;
import myky.com.doctorapp.entity.LoginSuccessEntity;
import myky.com.doctorapp.entity.SmsCodeEntity;
import myky.com.doctorapp.base.BaseEntity;
import myky.com.doctorapp.base.BaseView;

/**
 * Description:
 *
 * @author Mr.li
 * Ctreated by 2018/12/13 17:38
 */
public interface PnLoginFragmentContract {

    interface Model {
        /**
         * 手机验证码登录
         *
         * @return
         */
        Observable<BaseEntity<LoginSuccessEntity.PayLoadBean>> quickLogin();

        /**
         * 获取手机验证码
         *
         * @return
         */
        Observable<BaseEntity<SmsCodeEntity.PayloadBean>> getSmsCode(String mobile, String opt);
    }

    interface View extends BaseView<LoginEntity.PayLoadBean> {
        /**
         * 登录成功
         *
         * @param infoBean
         */
        void loginSuccess(LoginSuccessEntity.PayLoadBean infoBean);

        /**
         * 获取验证码成功
         *
         * @param codeEntity
         */
        void showCode(SmsCodeEntity.PayloadBean codeEntity);

        /**
         * 获取验证码失败
         */
        void getCodeError(int errorCode);
    }

    interface Presenter {
        void quickLogin();

        void getSmsCode(String mobile, String opt);
    }
}
